package com.wetech.demo.web3j.contracts.vestingwallet;

import io.reactivex.Flowable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.web3j.abi.EventEncoder;
import org.web3j.abi.FunctionEncoder;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Address;
import org.web3j.abi.datatypes.CustomError;
import org.web3j.abi.datatypes.Event;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.DefaultBlockParameter;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.core.RemoteFunctionCall;
import org.web3j.protocol.core.methods.request.EthFilter;
import org.web3j.protocol.core.methods.response.BaseEventResponse;
import org.web3j.protocol.core.methods.response.Log;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;

/**
 * <p>Auto generated code.
 * <p><strong>Do not modify!</strong>
 * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
 * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the 
 * <a href="https://github.com/LFDT-web3j/web3j/tree/main/codegen">codegen module</a> to update.
 *
 * <p>Generated with web3j version 4.14.0.
 */
@SuppressWarnings("rawtypes")
public class VestingWallet extends Contract {
    public static final String BINARY = "60c0604052604051610ab4380380610ab4833981016040819052610022916100dc565b826001600160a01b03811661005057604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b61005981610072565b506001600160401b039182166080521660a05250610129565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160401b03811681146100d7575f5ffd5b919050565b5f5f5f606084860312156100ee575f5ffd5b83516001600160a01b0381168114610104575f5ffd5b9250610112602085016100c1565b9150610120604085016100c1565b90509250925092565b60805160a05161095c6101585f395f8181610127015281816104d401526105b201525f6104ae015261095c5ff3fe6080604052600436106100dc575f3560e01c8063961325211161007c578063be9a655511610057578063be9a65551461024a578063efbe1c1c1461025e578063f2fde38b14610272578063fbccedae14610291575f5ffd5b806396132521146101e35780639852595c146101f7578063a3f8eace1461022b575f5ffd5b8063715018a6116100b7578063715018a614610176578063810ec23b1461018a57806386d1a69f146101a95780638da5cb5b146101bd575f5ffd5b80630a17b06b146100e75780630fb5a6b4146101195780631916558714610155575f5ffd5b366100e357005b5f5ffd5b3480156100f2575f5ffd5b50610106610101366004610826565b6102a5565b6040519081526020015b60405180910390f35b348015610124575f5ffd5b507f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff16610106565b348015610160575f5ffd5b5061017461016f366004610855565b6102c8565b005b348015610181575f5ffd5b50610174610360565b348015610195575f5ffd5b506101066101a436600461086e565b610373565b3480156101b4575f5ffd5b50610174610406565b3480156101c8575f5ffd5b505f546040516001600160a01b039091168152602001610110565b3480156101ee575f5ffd5b50600154610106565b348015610202575f5ffd5b50610106610211366004610855565b6001600160a01b03165f9081526002602052604090205490565b348015610236575f5ffd5b50610106610245366004610855565b610477565b348015610255575f5ffd5b506101066104a3565b348015610269575f5ffd5b506101066104d1565b34801561027d575f5ffd5b5061017461028c366004610855565b610514565b34801561029c575f5ffd5b50610106610553565b5f6102c26102b260015490565b6102bc90476108b3565b83610570565b92915050565b5f6102d282610477565b6001600160a01b0383165f908152600260205260408120805492935083929091906102fe9084906108b3565b90915550506040518181526001600160a01b038316907fc0e523490dd523c33b1878c9eb14ff46991e3f5b2cd33710918618f2a39cba1b9060200160405180910390a261035c826103565f546001600160a01b031690565b83610612565b5050565b610368610669565b6103715f610695565b565b6001600160a01b0382165f908152600260205260408120546103ff906040516370a0823160e01b81523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa1580156103d1573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103f591906108c6565b6102bc91906108b3565b9392505050565b5f61040f610553565b90508060015f82825461042291906108b3565b90915550506040518181527fda9d4e5f101b8b9b1c5b76d0c5a9f7923571acfc02376aa076b75a8c080c956b9060200160405180910390a161047461046e5f546001600160a01b031690565b826106e4565b50565b6001600160a01b0381165f908152600260205260408120546104998342610373565b6102c291906108dd565b67ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690565b5f7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff166105056104a3565b61050f91906108b3565b905090565b61051c610669565b6001600160a01b03811661054a57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61047481610695565b5f61055d60015490565b610566426102a5565b61050f91906108dd565b5f6105796104a3565b8267ffffffffffffffff16101561059157505f6102c2565b6105996104d1565b8267ffffffffffffffff16106105b05750816102c2565b7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff166105e36104a3565b6105f79067ffffffffffffffff85166108dd565b61060190856108f0565b61060b9190610907565b90506102c2565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610664908490610776565b505050565b5f546001600160a01b031633146103715760405163118cdaa760e01b8152336004820152602401610541565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8047101561070e5760405163cf47918160e01b815247600482015260248101829052604401610541565b5f5f836001600160a01b0316836040515f6040518083038185875af1925050503d805f8114610758576040519150601f19603f3d011682016040523d82523d5f602084013e61075d565b606091505b50915091508161077057610770816107e2565b50505050565b5f5f60205f8451602086015f885af180610795576040513d5f823e3d81fd5b50505f513d915081156107ac5780600114156107b9565b6001600160a01b0384163b155b1561077057604051635274afe760e01b81526001600160a01b0385166004820152602401610541565b8051156107f157805160208201fd5b60405163d6bda27560e01b815260040160405180910390fd5b803567ffffffffffffffff81168114610821575f5ffd5b919050565b5f60208284031215610836575f5ffd5b6103ff8261080a565b80356001600160a01b0381168114610821575f5ffd5b5f60208284031215610865575f5ffd5b6103ff8261083f565b5f5f6040838503121561087f575f5ffd5b6108888361083f565b91506108966020840161080a565b90509250929050565b634e487b7160e01b5f52601160045260245ffd5b808201808211156102c2576102c261089f565b5f602082840312156108d6575f5ffd5b5051919050565b818103818111156102c2576102c261089f565b80820281158282048414176102c2576102c261089f565b5f8261092157634e487b7160e01b5f52601260045260245ffd5b50049056fea264697066735822122003cd97a4afa4cc5fae1c0f07ce578da3dc73cfb10e6057af669f9187cc999b7264736f6c634300081d0033";

    private static String librariesLinkedBinary;

    public static final String FUNC_DURATION = "duration";

    public static final String FUNC_END = "end";

    public static final String FUNC_OWNER = "owner";

    public static final String FUNC_releasable = "releasable";

    public static final String FUNC_release = "release";

    public static final String FUNC_released = "released";

    public static final String FUNC_RENOUNCEOWNERSHIP = "renounceOwnership";

    public static final String FUNC_START = "start";

    public static final String FUNC_TRANSFEROWNERSHIP = "transferOwnership";

    public static final String FUNC_vestedAmount = "vestedAmount";

    public static final CustomError FAILEDCALL_ERROR = new CustomError("FailedCall", 
            Arrays.<TypeReference<?>>asList());
    ;

    public static final CustomError INSUFFICIENTBALANCE_ERROR = new CustomError("InsufficientBalance", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
    ;

    public static final CustomError OWNABLEINVALIDOWNER_ERROR = new CustomError("OwnableInvalidOwner", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
    ;

    public static final CustomError OWNABLEUNAUTHORIZEDACCOUNT_ERROR = new CustomError("OwnableUnauthorizedAccount", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
    ;

    public static final CustomError SAFEERC20FAILEDOPERATION_ERROR = new CustomError("SafeERC20FailedOperation", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
    ;

    public static final Event ERC20RELEASED_EVENT = new Event("ERC20Released", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event ETHERRELEASED_EVENT = new Event("EtherReleased", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
    ;

    public static final Event OWNERSHIPTRANSFERRED_EVENT = new Event("OwnershipTransferred", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Address>(true) {}));
    ;

    @Deprecated
    protected VestingWallet(String contractAddress, Web3j web3j, Credentials credentials,
            BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    protected VestingWallet(String contractAddress, Web3j web3j, Credentials credentials,
            ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
    }

    @Deprecated
    protected VestingWallet(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    protected VestingWallet(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static List<ERC20ReleasedEventResponse> getERC20ReleasedEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ERC20RELEASED_EVENT, transactionReceipt);
        ArrayList<ERC20ReleasedEventResponse> responses = new ArrayList<ERC20ReleasedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            ERC20ReleasedEventResponse typedResponse = new ERC20ReleasedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.token = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static ERC20ReleasedEventResponse getERC20ReleasedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ERC20RELEASED_EVENT, log);
        ERC20ReleasedEventResponse typedResponse = new ERC20ReleasedEventResponse();
        typedResponse.log = log;
        typedResponse.token = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<ERC20ReleasedEventResponse> eRC20ReleasedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getERC20ReleasedEventFromLog(log));
    }

    public Flowable<ERC20ReleasedEventResponse> eRC20ReleasedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ERC20RELEASED_EVENT));
        return eRC20ReleasedEventFlowable(filter);
    }

    public static List<EtherReleasedEventResponse> getEtherReleasedEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ETHERRELEASED_EVENT, transactionReceipt);
        ArrayList<EtherReleasedEventResponse> responses = new ArrayList<EtherReleasedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            EtherReleasedEventResponse typedResponse = new EtherReleasedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static EtherReleasedEventResponse getEtherReleasedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ETHERRELEASED_EVENT, log);
        EtherReleasedEventResponse typedResponse = new EtherReleasedEventResponse();
        typedResponse.log = log;
        typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<EtherReleasedEventResponse> etherReleasedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getEtherReleasedEventFromLog(log));
    }

    public Flowable<EtherReleasedEventResponse> etherReleasedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ETHERRELEASED_EVENT));
        return etherReleasedEventFlowable(filter);
    }

    public static List<OwnershipTransferredEventResponse> getOwnershipTransferredEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(OWNERSHIPTRANSFERRED_EVENT, transactionReceipt);
        ArrayList<OwnershipTransferredEventResponse> responses = new ArrayList<OwnershipTransferredEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            OwnershipTransferredEventResponse typedResponse = new OwnershipTransferredEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.previousOwner = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.newOwner = (String) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static OwnershipTransferredEventResponse getOwnershipTransferredEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OWNERSHIPTRANSFERRED_EVENT, log);
        OwnershipTransferredEventResponse typedResponse = new OwnershipTransferredEventResponse();
        typedResponse.log = log;
        typedResponse.previousOwner = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.newOwner = (String) eventValues.getIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<OwnershipTransferredEventResponse> ownershipTransferredEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getOwnershipTransferredEventFromLog(log));
    }

    public Flowable<OwnershipTransferredEventResponse> ownershipTransferredEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(OWNERSHIPTRANSFERRED_EVENT));
        return ownershipTransferredEventFlowable(filter);
    }

    public RemoteFunctionCall<BigInteger> duration() {
        final Function function = new Function(FUNC_DURATION, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> end() {
        final Function function = new Function(FUNC_END, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<String> owner() {
        final Function function = new Function(FUNC_OWNER, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<BigInteger> releasable(String token) {
        final Function function = new Function(FUNC_releasable, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, token)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> releasable() {
        final Function function = new Function(FUNC_releasable, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> release(String token) {
        final Function function = new Function(
                FUNC_release, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, token)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> release() {
        final Function function = new Function(
                FUNC_release, 
                Arrays.<Type>asList(), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<BigInteger> released() {
        final Function function = new Function(FUNC_released, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> released(String token) {
        final Function function = new Function(FUNC_released, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, token)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> renounceOwnership() {
        final Function function = new Function(
                FUNC_RENOUNCEOWNERSHIP, 
                Arrays.<Type>asList(), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<BigInteger> start() {
        final Function function = new Function(FUNC_START, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> transferOwnership(String newOwner) {
        final Function function = new Function(
                FUNC_TRANSFEROWNERSHIP, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, newOwner)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<BigInteger> vestedAmount(BigInteger timestamp) {
        final Function function = new Function(FUNC_vestedAmount, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(timestamp)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> vestedAmount(String token, BigInteger timestamp) {
        final Function function = new Function(FUNC_vestedAmount, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, token), 
                new org.web3j.abi.datatypes.generated.Uint64(timestamp)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    @Deprecated
    public static VestingWallet load(String contractAddress, Web3j web3j, Credentials credentials,
            BigInteger gasPrice, BigInteger gasLimit) {
        return new VestingWallet(contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    @Deprecated
    public static VestingWallet load(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return new VestingWallet(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    public static VestingWallet load(String contractAddress, Web3j web3j, Credentials credentials,
            ContractGasProvider contractGasProvider) {
        return new VestingWallet(contractAddress, web3j, credentials, contractGasProvider);
    }

    public static VestingWallet load(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return new VestingWallet(contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static RemoteCall<VestingWallet> deploy(Web3j web3j, Credentials credentials,
            ContractGasProvider contractGasProvider, BigInteger initialWeiValue, String beneficiary,
            BigInteger startTimestamp, BigInteger durationSeconds) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, beneficiary), 
                new org.web3j.abi.datatypes.generated.Uint64(startTimestamp), 
                new org.web3j.abi.datatypes.generated.Uint64(durationSeconds)));
        return deployRemoteCall(VestingWallet.class, web3j, credentials, contractGasProvider, getDeploymentBinary(), encodedConstructor, initialWeiValue);
    }

    public static RemoteCall<VestingWallet> deploy(Web3j web3j,
            TransactionManager transactionManager, ContractGasProvider contractGasProvider,
            BigInteger initialWeiValue, String beneficiary, BigInteger startTimestamp,
            BigInteger durationSeconds) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, beneficiary), 
                new org.web3j.abi.datatypes.generated.Uint64(startTimestamp), 
                new org.web3j.abi.datatypes.generated.Uint64(durationSeconds)));
        return deployRemoteCall(VestingWallet.class, web3j, transactionManager, contractGasProvider, getDeploymentBinary(), encodedConstructor, initialWeiValue);
    }

    @Deprecated
    public static RemoteCall<VestingWallet> deploy(Web3j web3j, Credentials credentials,
            BigInteger gasPrice, BigInteger gasLimit, BigInteger initialWeiValue,
            String beneficiary, BigInteger startTimestamp, BigInteger durationSeconds) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, beneficiary), 
                new org.web3j.abi.datatypes.generated.Uint64(startTimestamp), 
                new org.web3j.abi.datatypes.generated.Uint64(durationSeconds)));
        return deployRemoteCall(VestingWallet.class, web3j, credentials, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor, initialWeiValue);
    }

    @Deprecated
    public static RemoteCall<VestingWallet> deploy(Web3j web3j,
            TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit,
            BigInteger initialWeiValue, String beneficiary, BigInteger startTimestamp,
            BigInteger durationSeconds) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, beneficiary), 
                new org.web3j.abi.datatypes.generated.Uint64(startTimestamp), 
                new org.web3j.abi.datatypes.generated.Uint64(durationSeconds)));
        return deployRemoteCall(VestingWallet.class, web3j, transactionManager, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor, initialWeiValue);
    }

    public static void linkLibraries(List<Contract.LinkReference> references) {
        librariesLinkedBinary = linkBinaryWithReferences(BINARY, references);
    }

    private static String getDeploymentBinary() {
        if (librariesLinkedBinary != null) {
            return librariesLinkedBinary;
        } else {
            return BINARY;
        }
    }

    public static class ERC20ReleasedEventResponse extends BaseEventResponse {
        public String token;

        public BigInteger amount;
    }

    public static class EtherReleasedEventResponse extends BaseEventResponse {
        public BigInteger amount;
    }

    public static class OwnershipTransferredEventResponse extends BaseEventResponse {
        public String previousOwner;

        public String newOwner;
    }
}
